<?php /* Smarty version Smarty-3.1.14, created on 2017-08-25 17:07:24
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\peisong_edit.html" */ ?>
<?php /*%%SmartyHeaderCode:400359950181e0b114-05873636%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '0ed655939a98509ba1cb1133e83ad80e9be8eb2e' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\peisong_edit.html',
      1 => 1503652011,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '400359950181e0b114-05873636',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_59950181e3a261_41777186',
  'variables' => 
  array (
    'res' => 0,
    'list' => 0,
    'res1' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_59950181e3a261_41777186')) {function content_59950181e3a261_41777186($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style>
input {	width: 240px;}
textarea {	width: 350px;	height: 100px;}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>添加配送员</h3>
  </div>
</div>
<div class="fixed_bottom">
  <form method="post" action="peisong.php" enctype="multipart/form-data" id="aspnetForm" name="form1">
    <table style=" width:100%;" cellpadding="0" cellspacing="0" class="table tb-type2">
      <tbody>
       <tr>
            <td class="firtd">所属商户: </td>
              <td>
                <select name="s_id" id="" class="form-control">
                  <?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['res']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['list']->key;
?>
                    <option <?php if ($_smarty_tpl->tpl_vars['list']->value['s_id']==$_smarty_tpl->tpl_vars['res1']->value['user_shid']){?> selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['list']->value['s_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['list']->value['shop_name'];?>
</option>
                  <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
          <td class="firtd">配送员名称:</td>
          <td>
          	<input type="text" name="user_name" id='user_name' value="<?php echo $_smarty_tpl->tpl_vars['res1']->value['user_name'];?>
"required>
          </td>
        </tr>
        <tr>
          <td class="style1">&nbsp;</td>
          <td>
          	<input type="hidden" name="act" value="insert">
            <input type="hidden" name="user_id" id="user_id" value="<?php echo $_smarty_tpl->tpl_vars['res1']->value['user_id'];?>
">
            <a href="JavaScript:void(0);" class="btn" onclick="reset()"><span>重置</span></a>
            <a href="JavaScript:void(0);" class="btn" onclick="$('#tj').click()"><span>确认提交</span></a>
          </td>
        </tr>
      </tbody>
    </table>
    <input type="reset" id="cz" style="display: none;">
    <input type="submit" id="tj" style="display:none;">
  </form>
</div>
</body>
<script>
    // 重置方法
    function reset(){
	$('input').val('');
	$('textarea').text('');
	$('select').val('');
}
$("#user_name").blur(function(){
  var name = $("#user_name").val();
  $.post("peisong.php",{act:'name',user_name:name},function(data){
    if(data==1){
        alert('配送员不存在');
        $('input').val('');
        $('textarea').text('');
        $('select').val('');
    }
    if(data==4){
        alert('名称不能为空');
        $('input').val('');
        $('textarea').text('');
        $('select').val('');
    }
    if(data==3){
        alert('配送员已分配至其他店铺');
        $('input').val('');
        $('textarea').text('');
        $('select').val('');    }
  });
});
</script>
</html><?php }} ?>